<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<c:set var="ctx" value="${pageContext.request.contextPath}"/>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>O2O[C] - ${ merchant.mName }</title>
    
    <link rel="stylesheet" href="${ctx}/assets/css/bootstrap.min.css">
    <link rel="stylesheet" href="${ctx}/assets/css/dishes.css">
</head>
<body>
    <div class="mask close-cart-menu"></div>
    <input name="mid" type="hidden" value="${param.mid}">
   
    <nav class="navbar navbar-inverse">
        <div class="container-fluid">
            <!-- Brand and toggle get grouped for better mobile display -->
            <div class="navbar-header">
                <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1" aria-expanded="false">
                    <span class="sr-only">Toggle navigation</span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                </button>
                <a class="navbar-brand" href="home">O2O[C]</a>
            </div>

            <!-- Collect the nav links, forms, and other content for toggling -->
            <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">

                <ul class="nav navbar-nav navbar-right">
                    <li id="search-dtype" class="dropdown" data-index="0">
                        <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">所有 <span class="caret"></span></a>
                        <ul class="dropdown-menu">
                            <c:forEach items="${ dishTypes }" var="t" varStatus="status">
                                <li><a href="#" class="dish-type-selector" data-index="${status.index}">${ t.dishTypeName }</a></li>
                            </c:forEach>
                        </ul>
                    </li>
                    <li>
                        <form id="search-form" class="navbar-form navbar-left" role="search">
                            <div class="form-group input-group">
                                <input type="text" class="form-control" placeholder="Search">
                                <a href="javascript:void(0)" class="input-group-addon"><span class="glyphicon glyphicon-search"></span></a>
                            </div>
                        </form>
                    </li>
                    <li class="dropdown">
                        <a href="javascript:void(0);" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">${loginCustomerName} <span class="caret"></span></a>
                        <ul class="dropdown-menu">
                            <li><a href="${ctx}/logout.action">Logout</a></li>
                        </ul>
                    </li>
                </ul>
            </div><!-- /.navbar-collapse -->
        </div><!-- /.container-fluid -->
    </nav>
    
    <div class="jumbotron">
        <div class="container">
            <div class="row">
                <div class="col-sm-12 col-md-8">
                    <h1>${ merchant.mName }</h1>
                    <p>Address: ${ merchant.mAddr }</p>
                </div>
                <div class="col-sm-12 col-md-4">
                    <img class="shop-logo" src="${ctx}/local/${ merchant.mHeadImg }">
                </div>
            </div>
            
        </div>
    </div>
    
    <div class="container">
        <div id="main-content">
            <div class="row">
                <c:forEach items="${ dishes }" var="d">
                    <div class="col-sm-12 col-md-6 col-lg-4" data-did="${ d.dId }">
                        <div class="thumbnail">
                            <div class="dish-img">
                                <img src="${ ctx }/local/${ d.dImage }">
                                <button class="btn btn-warning add-to-cart"><span class="glyphicon glyphicon-plus"></span>Add to Cart</button>
                            </div>
                            <div class="dish-info">
                                <div class="caption">
                                    <h3>${ d.dName }</h3>
                                    <p>${ dishTypes.get(d.dType).dishTypeName }</p>
                                    <h4>${ d.dPrice }</h4>
                                </div>
                            </div>
                            <div class="clear"></div>
                        </div>
                    </div>
                </c:forEach>
            </div>
        </div>
        <footer></footer>
        <div id="fixed-btns">
            <button id="open-cart-btn" class="btn btn-success btn-lg"><i class="glyphicon glyphicon-shopping-cart"></i></button>
        </div>
        <div id="cart-menu">
            <div>
                <a href="javascript:void(0);" class="close-cart-menu"><span class="glyphicon glyphicon-chevron-left"></span> Back</a>
            </div>
           
            <ul id="cart-list" class="list-group">
            </ul>
            
            <div>
                <div class="panel panel-default">
                    <div class="panel-body">
                        Total Price: <strong>0.00</strong>
                    </div>
                </div>
                <button id="cart-pay" class="btn btn-success">Pay the Bill</button>
            </div>
        </div>
    </div>
    
    <script type="text/javascript" src="${ctx}/assets/js/jquery.min.js"></script>
    <script type="text/javascript" src="${ctx}/assets/js/jquery-ui.js"></script>
    <script type="text/javascript" src="${ctx}/assets/js/bootstrap.min.js"></script>
    <script type="text/javascript" src="${ctx}/assets/js/dishes.js"></script>
</body>
</html>